package com.hexacta.hrs.securitygroups;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.vectrics.common.db.RecordObject;

/**
 * Clase que representa un permiso especifico para un permiso.
 * 
 * @author mtestasecca
 * @author rmilano
 */
public class Permission implements RecordObject, Serializable {

    private static final long serialVersionUID = -8883121376079318545L;

    /** id. */
    private Long id;

    /** Nombre del Permiso. */
    private PermissionName name;

    /** Description del Permiso. */
    private String description;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (!getClass().isAssignableFrom(obj.getClass())) {
            return false;
        }
        Permission otherPermission = (Permission) obj;

        return new EqualsBuilder().append(this.getName(), otherPermission.getName()).isEquals();
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

	public void setName(PermissionName name) {
		this.name = name;
	}

	public PermissionName getName() {
		return name;
	}

    

}